import React, { Component } from 'react'
import '../assets/css/order.css'
class order extends Component {
    constructor() {
        super()
        
        this.state = {
            goodsDetail: [],
            orderList:[],
            objInfo: '',
            orderprice:''
        }
    }

    componentDidMount() {

        this.setState({
            goodsDetail: sessionStorage.getItem('goodsDetail')?JSON.parse(sessionStorage.getItem('goodsDetail')):[],
            objInfo: sessionStorage.getItem('objInfo')?JSON.parse(sessionStorage.getItem('objInfo')):[],
            orderprice:sessionStorage.getItem('goodsDetail')?JSON.parse(sessionStorage.getItem('goodsDetail')).price:[],
            
        })
    }
 
    render() {
        console.log(this.state.goodsDetail,'11111111111');
        const { goodsDetail, } = this.state
        return (

            <div className='hea' >
                <header>
                    <div className="top_box">

                        <h1>确定订单</h1>
                    </div>
                </header>
                <div className='title'>
                    <div className='addresscar'>
                        <div className="bu">
                            <p className="dai">代用名 188 **** 8888</p>
                            <p className="p1">
                                北京 北京市 昌平区  <br />
                                朱辛庄中公教育实训基地IT教学楼 2号楼 2202室
                            </p>
                        </div>
                    </div>
                    <div className='zhong '>
                        <img src={require('../assets/img/ziying.png')} alt="" />
                        <span className="pin">品牌精选</span>
                        <span className="mian">已免运费</span>
                        <span className="line"></span>
                        <span className="ling">领劵</span>
                    </div>


                    {
                        goodsDetail.map(item => {
                            return (
                                <div className='labelcommo' key={item.id}>
                                    <img src={item.img} alt="" />
                                    <div className='rigth'>
                                        <p className='c'>
                                            <span className='spanl'>限时</span>
                                            <span className='shan'>{item.goodsname}</span>
                                        </p>
                                        <p className='min'>
                                            敏感肌可用,控油祛痘，男女可用...
                                        </p>
                                        <div className='rigth-xia'>
                                            <div>
                                                <span className='span5'>&yen;{item.price}</span>
                                                <span className='span4'><del>&yen;1099</del></span>
                                                <br />
                                                <div className='cart'>7天无理由退货</div>
                                                <div className='cart1'>特价</div>
                                                <div className='cart3'>x</div>
                                                <div className='cart4'>{item.num || item.ishot}</div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            )
                        })
                    }
                  
                    <div className='fonttitlet'>
                        <p className="fa">
                            <span>发票类型</span>
                            <span>不开发票 </span>
                        </p>
                        <p className="fang">
                            <span>售后免邮</span>
                            <span className="pa">部分商家赠送</span>
                        </p>
                        <p className="fang1">
                            <span>买家留言</span>
                            <span className="p">填写内容需要与商家协商并确认，45字以内</span>
                        </p>
                    </div>
                    <div className='font'>
                        <div className="lin"></div>c
                        <p className="fa ">
                            <span>商品金额</span>
                            <span>&yen;1998</span>
                        </p>
                        <p className="fang">
                            <span>优惠活动</span>
                            <span className="iconfont icon--hao1">- &yen;200</span>
                        </p>
                        <p className="fang1">
                            <span>优惠卷</span>
                            <span>暂无可用</span>
                        </p>
                    </div>
                </div>
                <div className='bottom_bg'>
                    <div className="xiamian">
                        <div className="kuai q1">
                            <span className="dazi">合计</span> <br />
                            <span className="xiaozihei">已免运费</span>
                        </div>
                        <div className="kuai z q2">
                            {/* {this.state.goodsDetail.price ? (<span className="dazih">&yen;{this.state.goodsDetail.price}</span>):( (<span className="dazih">&yen;{this.state.objInfo.countmoney}</span>))} */}
                            <span className="dazih">&yen;{(this.state.objInfo.countmoney)}</span>
                            {/* <span className="dazih">&yen;{this.state.objInfo.countmoney ? (this.goodsDetail.state.price) :(this.state.objInfo.countmoney)}</span> */}
                            <br />
                            <span className="xiaozihei">已优惠&yen;200元</span>
                        </div>
                        <span className="jiesuan" >立即支付</span>
                    </div>
                    <div className="xian"></div>
                </div>

            </div>
        )
    }

}
export default order